<template>
  <div>
    <span>{{ shop.shopName }} </span>
    <button @click="add(idx)">+</button>
    <span> {{ shop.count }} </span>
    <button @click="del(idx)">-</button>
  </div>
</template>
<script>
export default {
  props: ["shop", "idx"],
  created() {
    // console.log(this.shop);
  },
  methods: {
    //   子传父触发事件
    add() {
      this.$emit("add");
    },
    del() {
      this.$emit("del");
    },
  },
};
</script>

<style>
</style>